package pacman.base;

import org.newdawn.slick.geom.Shape;
import org.newdawn.slick.geom.Vector2f;

public abstract class Body implements Entity {
    public Shape shape;

    protected Role role;

    public Body(Role role, Shape shape) {
    	this.role = role;
    	this.shape = shape;
    }

    public float getCenterX() {
	return shape.getCenterX();
    }

    public float getCenterY() {
	return shape.getCenterY();
    }

    public float getX() {
	return shape.getX();
    }

    public float getY() {
	return shape.getY();
    }

    public float getWidth() {
	return shape.getMaxX() - shape.getX();
    }

    public float getHeight() {
	return shape.getMaxY() - shape.getY();
    }

    @Override
    public String toString() {
	return "Body[" + getCenterX() + "," + getCenterY() + "]";
    }

    public Vector2f getPosition() {
		Vector2f pos = new Vector2f();
		pos.set(shape.getX(), shape.getY());
		return pos;
    }
}
